<template>
	<body>
		<div class="loan_nav">
			<ul>
				<li></li>
				<li></li>
				<li></li>
			</ul>
		</div>
		<div class="login_flex">
			<div class="interval_T">
				
			</div>
			<div class="login_title">
				<img :src="$root.orgInfo.logo" width="40%;">
			</div>
			<div  class="login_form">
				<ul class="tel_input">
					<li><input v-model="params.mobile" type="tel"  placeholder="输入手机号" maxlength="11"></li>
					<!-- <li><input  @click="sendSms" type="button" value="获取验证码" > </li> -->
				</ul>
				<!-- <ul class="tel_input">
					<li><input v-model="params.randCode" type="text" placeholder="输入短信中的验证码" maxlength="6"></li>
				</ul> -->
				<ul class="tel_input">
					<li><input v-model="params.password" type="password" placeholder="账号登入密码"></li>
				</ul>
				<ul class="remenber_nub"  @click="showIcon=!showIcon">
					<li>
						<div><i v-show="showIcon" class="iconfont">&#xe67f;</i></div>
					</li>
					<li><p>记住手机号</p></li>
				</ul>
			</div>
			<div class="btn">
				<a><input @click="login" type="button" value="登入" class="login_btn" /></a>
			</div>
			<div class="forget">
				<ul>
					<li>
						<router-link to="retrievepassword"><p>忘记密码</p></router-link>
						
					</li>
					<li>
						<router-link to="register"><p>立即注册</p></router-link>
					</li>
				</ul>
			</div>
			<div class="line_flex">

			</div>
			<div class="bottom_text">
				<p class="col_dg">软件APP版权归{{$root.orgInfo.companyName}}所有</p>
				<p class="col_dg">因为努力所以有价值</p>
			</div>
		</div>
	</body>
</template>

<script>
export default {
	data() {
		return {
			params: {
				// codeType: 'login',
				// randType: 'login'
			},
			showIcon: false
		}
	},
	created() {
		this.params.mobile = localStorage.getItem('mobile')
	},
	methods: {
		// sendSms() {
		// 	this.$http.post('/app/randCode', this.params).then(json => {
		// 		const { code, msg } = json
		// 		if(code === 0) {
		// 			this.$vux.toast.show({ text: msg })
		// 		}
		// 	})
		// },
		login() {
			if(this.showIcon) {
				localStorage.setItem('mobile', this.params.mobile)
			}
			this.$http.post('/app/login', this.params).then(json => {
				const { code, token } = json
				if(code === 0) {
					this.$root.$data.token = token
					this.$router.push('/home')
				}
			})
		}
	}
}
</script>

<style>
</style>